home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aai.d64
/
merrimanager 2.6
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
7KB
|
227 lines
10 REM LIST 3000-
15 REM********************************
20 REM* MERRIMANAGER 2.6 *
25 REM* RE=MAX. # OF RECORDS:- *
30 REM* NOW SET AT 300. *
35 REM* RETAINS ORIGINAL ORDER *
40 REM* WHEN SAVED TO DISK. *
45 REM*PRINTS ORIG. REC. NO. ON PRINT*
50 REM********************************
55 :
80 RE=300:FE=10:R=0:O$="BRFEADPLSCNM\X":DN$=""
90 DIMD$(RE,FE),D%(RE),FT$(FE):FI$="NEW FILE":PRINTCHR$(142)
96 :
98 REM** WARM START **
100 POKE53281,15:POKE646,11:CLOSE15:OPEN15,8,15
102 POKE53280,12:M=0:GOTO900
103 :
106 REM** SORT **
108 T=D%(K):D%(K)=D%(I):D%(I)=T:RETURN
110 PRINT"[147] SORT [146][144]"
112 PRINT"":FORK=1TOF:PRINT" "K"[157] [146] "FT$(K):NEXT
114 PRINT"ENTER NUMBER SHOWING":PRINT"CATEGORY TO SORT"
116 INPUT"(0 TO QUIT) 0[157][157][157]";FC:IFFC=0THENRETURN
118 IFFC>FTHENPRINT"[145][145][145]":GOTO116
120 PRINT"[147]SORTING PLEASE WAIT":M=2^INT(LOG(R)/LOG(2))-1
122 FORJ=1TOR-M:I=J
124 K=I+M:IFD$(D%(I),FC)>D$(D%(K),FC)THENGOSUB108:I=I-M:IFI>.THEN124
126 NEXT:M=INT(M/2):IFM>.THEN122
128 RETURN
196 :
198 REM** LOAD **
200 PRINT"[147] LOAD FILE [146][144]":FK$=FI$
201 PRINT"":FI$=""
202 PRINT" 'RETURN' TO CANCEL[146]"
203 PRINT"ENTER FILE NAME";:INPUT" [157][157][157]";FI$:IFFI$=""THENFI$=FK$:RETURN
204 CLOSE8:OPEN8,8,8,"0:MM/"+FI$+",S,R":INPUT#15,E,A$:IFETHENFI$=FK$:GOTO938
206 PRINTLEFT$(DN$,21)" PLEASE WAIT "
208 INPUT#8,FI$:INPUT#8,F:FORI=1TOF:INPUT#8,FT$(I):NEXT
210 FORI=1TORE:PRINTLEFT$(DN$,10)"READING RECORD # "I
212 D%(I)=I:FORJ=1TOF:INPUT#8,D$(I,J):NEXT:L=ST
214 IFL=.THENNEXT
216 IFL=64THENR=I:GOTO220
218 PRINT"BAD STATUS"L:FORX=1TO3000:NEXT:GOTO200
220 I=RE:NEXT:CLOSE8:RETURN
296 :
298 REM** SAVE **
300 PRINT"[147] SAVE [146][144]"
302 PRINT"EXISTING FILE: "FI$
304 PRINT"'RETURN' TO CANCEL"
306 PRINT"ENTER FILE NAME <= 13 CHARACTERS":INPUTZ$:IFZ$=""THENRETURN
308 IFZ$=FI$THENINPUT"SCRATCH ORIGINAL FILE N[157][157][157]";A$:IFA$="N"THENRETURN
310 IFZ$=FI$THENPRINT#15,"S0:MM/"+FI$:PRINT"OLD "CHR$(34)Z$CHR$(34)" SCRATCHED"
312 INPUT#15,E,A$:IFE<>0ANDE<>1ANDE<>73THEN938
314 CLOSE8:OPEN8,8,8,"0:MM/"+Z$+",S,W":INPUT#15,E,A$:IFETHEN938
316 FI$=Z$:PRINT#8,FI$:PRINT#8,F:FORI=1TOF:PRINT#8,FT$(I):NEXTI
318 FORI=1TOR:FORJ=1TOF:IFD$(I,J)=""THEND$(I,J)="\"
320 PRINT#8,D$(I,J):NEXTJ
322 PRINTLEFT$(DN$,14)"WRITING RECORD #"I
324 PRINT"OF NEW FILE "CHR$(34)FI$CHR$(34):NEXTI
326 CLOSE8:RETURN
396 :
398 REM** FIELD TITLES **
400 PRINT"[147] NEW OR ADD OR CHANGE FIELD TITLES [144]":PRINT" 'RETURN' TO CANCEL "
401 A=0:PRINT"ENTER NUMBER OF FIELDS"
402 PRINT"PER RECORD ( 1-"FE"):";:INPUTA$:IFVAL(A$)>FETHEN400
403 IFVAL(A$)=0THENRETURN
404 F=VAL(A$):PRINT"ENTER FIELD TITLES:"
406 FORI=1TOF:PRINTI;:INPUT"[157]";FT$(I):NEXT:RETURN
496 :
498 REM** BROWSE **
500 PRINT"[147] BROWSE [146][144]"
501 INPUT"BEGIN AT RECORD # 1[157][157][157]";S
502 IFS>RTHENPRINT" ONLY "R" RECORDS ":GOTO999
503 FORJ=STOR
504 GOSUB550
506 PRINT""TAB(29)"[144]C[146]ONTINUE":PRINTTAB(29)"[144]Q[146]UIT";
507 INPUT" C[157][157][157]";A$:IFA$="Q"THENJ=R
508 NEXTJ:RETURN
550 PRINT"[147]RECORD #"J:FORK=1TOF:PRINTLEFT$(DN$,2*K+3)""FT$(K)
552 PRINTRIGHT$(" "+STR$(K),3)". "D$(D%(J),K):NEXTK:RETURN
596 :
598 REM** FIND **
600 PRINT"[147] FIND A RECORD [144]"
601 FU=0:S$=""
602 FORK=1TOF:PRINT" "K"[157] [146]"FT$(K):NEXT
603 PRINT"ENTER LINE # SHOWING":PRINT"CATEGORY TO SEARCH";:INPUT" 0[157][157][157]";FU
604 IFFU=0THENRETURN
606 IFFU>FTHENPRINT"[145][145][145][145][145][145]":GOTO603
610 INPUT"ENTER SEARCH VALUE";S$
612 L=LEN(S$):IFS$=""THENPRINT"[145][145]":GOTO610
620 FORJ=1TOR:IFLEFT$(D$(D%(J),FU),L)=S$THEN504
622 NEXT:RETURN
716 :
718 REM** ADD **
720 PRINT"[147] ADDING RECORD #"R+1
722 PRINT"[144] 'RETURN' TO CANCEL[146]"
724 R=R+1:D%(R)=R:J=R:FORK=1TOF:D$(R,K)="":NEXT
726 FORI=1TOF:PRINTLEFT$(DN$,2*I+3)""FT$(I)
728 PRINTRIGHT$(" "+MID$(STR$(I),2),2)" .[157]";
730 INPUTD$(D%(J),I):IFLEFT$(D$(D%(J),1),1)=""THENR=R-1:D%(R)=R:J=R:RETURN
732 IFD$(D%(J),I)=""THEND$(D%(J),I)="\"
734 Z=0:IFSW=1THENSW=0:RETURN
736 NEXT
740 INPUT"ENTER LINE # OF ANY CHANGES: 0[157][157][157]";I:IFI>FTHENPRINT"[145][145]";:GOTO740
743 IFI=0THENRETURN
746 SW=1:PRINT""LEFT$(DN$,2*I+4);
748 GOSUB728:GOTO740
756 :
758 REM** EDIT & DELETE **
760 PRINT"[147] DELETE RECORD [146][144]":IFI=4THENPRINT"[147] EDIT RECORD [146][144]"
761 INPUT"ENTER RECORD # 0[157][157][157]";J
762 IFJ=0THENRETURN
763 IFJ<1ORJ>RTHENPRINT"[145][145]";:GOTO760
764 GOSUB550:IFI=4THENZ=4:GOTO740:REM * EDIT *
778 PRINT" CAUTION RECORD NUMBERS CHANGE [144]"
780 DC$="M":INPUT"D[146]ELETE OR M[146]ENU M[157][157][157]";DC$
782 IFLEFT$(DC$,1)="M"THENRETURN
786 TE=D%(J):FORI=JTOR-1:D%(I)=D%(I+1):NEXT
788 FORK=1TOF:D$(TE,K)=D$(R,K):D$(R,K)="":NEXT
790 FORI=1TOR-1:IFD%(I)=RTHEND%(I)=TE:I=R
792 NEXT:D%(R)=0:R=R-1:PRINT"[147]OLD RECORD #"J"DELETED":GOTO999
796 :
798 REM** PRINT **
800 PRINT"[147] PRINT RECORDS [146][144]":PRINT"[156] IF PRINTER READY PRESS 'RETURN'[144]"
801 GETA$:IFA$<>CHR$(13)THEN801
802 INPUT"ENTER STARTING RECORD # [157][157][157]";S:IFS=0THENS=1
803 IFS>RTHEN806
804 PRINT"ENDING RECORD # 0";:INPUT"[157][157][157]";E:IFE<SORE=0THENPRINT" ERROR":GOTO999
806 IFE>RORS>RTHENPRINT"[147] ONLY"STR$(R)" RECORDS ENTERED":GOTO999
808 PRINT"[156]DO YOU WANT A TITLE? Y/N"
810 GETT$:IFT$=""THEN810
812 IFT$="Y"THEN PRINT"[144]PLEASE ENTER TITLE":INPUTC$
814 PRINT"[147]PRINT RECORDS[146][144]"
816 PRINT"HOLD <SPACE BAR> TO PAUSE"
818 CLOSE4:OPEN4,4:IFT$="Y"THENPRINT#4,CHR$(14)SPC(20-(LEN(C$)/2));C$:C$=""
820 PRINT#4,CHR$(15):PRINT#4,CHR$(17)
822 FORI=STOE:PRINT#4,CHR$(16);"19";D%(I):REM RECORD NUMBER
824 FORJ=1TOF:PRINT#4,D$(D%(I),J):NEXTJ
826 GETA$:IFA$=CHR$(32)THEN830
828 PRINT#4:GOSUB2000:NEXTI:CLOSE4:RETURN
830 PRINT"TO CONTINUE PRESS <C>":PRINT"TO END PRINT PRESS <E>"
832 GETA$:IFA$=""THEN832
834 IFA$="E"THENPRINT#4:CLOSE4:RETURN
836 IFA$="C"THENPRINT"[145][145][145] ":PRINT" ":GOTO828
838 GOTO832
896 :
898 REM** MENU **
900 PRINT"[147] MERRIMANAGER 2.6 [146]":PRINT" [156] FILE: "FI$"[146][144]"
901 PRINTR"/"RE
902 PRINT" C [146] CHANGE HEADINGS OR START RECORDS"
903 PRINT" L [146] LOAD OR S [146] SAVE THE RECORDS"
904 PRINT" F [146] FIND OR E [146] EDIT A RECORD"
905 PRINT" A [146] ADD OR D [146] DELETE A RECORD"
906 PRINT" B [146] BROWSE THRU RECORDS"
907 PRINT" R [146] REARRANGE THE RECORDS (SORT)"
908 PRINT" P [146] PRINT THE RECORDS"
909 PRINT" M [146] MEMORY CHECK \ [146] DIRECTORY"
910 PRINT" X [146] EXIT PROGRAM N [146] NEW FILE
911 [153]" ENTER OPTION WAIT ?"
912 [161]A$:[139]A$[178]""[167]912
914 [129]J[178]1[164]14:[139][202](O$,J,1)[178]A$[167]I[178]J:J[178]14:[130]:[137]918
916 [130]:[137]912
918 [139]I[178]8[176]I[178]10[176]I[178]12[176]I[178]13[176]I[178]14[167]922
919 [139]I[178]5[175]F[177]0[167]922
920 [139]R[178]0[167][153]"LOAD NO RECORDS IN MEMORY STOP L OR STOP C STOP":[137]901
922 [145]I[141]500,110,600,760,720,760,800,200,300,400,1012,996,1052,1080
924 [137]900
934 :
936 [143]** DISK ERROR **
938 [153]"LOAD ERROR ON DISKSTOP":[153]"";A$:[160]8:[160]15:[159]15,8,15,"UI"
940 [153][200](DN$,19):[133]"PRESS 'RETURN' KEY";A$:[142]
992 :
994 [143]** MEMORY **
996 [153]"LOADPLEASE WAIT - FORCED GARBAGE COLLECTION"
998 [153]""[184](0)"CMD WAITSPACES REMAIN"
999 [153][200](DN$,21)"STOP PRESS 'RETURN' KEY";:[133]A$:[142]
1008 :
1010 [143]** NEW FILE **
1012 [153]"LOAD ERASE ALL RECORDS IN MEMORY AND RE-RUN STOP"
1014 [133]" ARE YOU SURE Y/N NCMDCMDCMD";A$
1016 [139]A$[178]"Y"[167][138]
1018 [142]
1048 :
1050 [143]** DISK DIRECTORY **
1052 [160]8:[159]8,8,0,"$0":[132]15,E,A$:[139]E[167]938
1054 [153]"LOADDATA FILE DIRECTORY WAITSTOP":C[178]0:D$[178]""
1056 [161]#8,A$,A$
1058 [161]#8,A$,A$:[139]A$[178]""[167][160]8:[137]1070
1060 [161]#8,A$:[139]A$[179][177]""[167]D$[178]D$[170]A$:[137]1060
1062 [139][202](D$,2,3)[178]"MM/"[167]A[178]5:[137]1068
1064 [139][202](D$,3,3)[178]"MM/"[167]A[178]6:[137]1068
1066 D$[178]"":[137]1058
1068 [153][202](D$,A,A[170]9):C[178]C[170]1:D$[178]"":[137]1058
1070 [139]C[178]0[167][153]"NO DATA FILES ON THIS DISK"
1072 [137]999
1076 :
1078 [143]** EXIT PROGRAM **
1080 [153]"LOAD ANY RECORDS WILL BE ERASED "
1082 [139]F[177]0[167][133]"STOPHAVE YOU SAVED THE RECORDS Y/N NCMDCMDCMD";A$
1084 [139]F[178]0[167][133]"STOPARE YOU SURE Y/N NCMDCMDCMD";A$
1088 [139]A$[178]"Y"[167][160]4:[160]8:[160]15
1089 [139]A$[178]"Y"[167][153]"LOADALL FILES CLOSED":[128]
1090 [142]
1980 :
1990 [143]** AUTO PAGEING **
2000 [139]I[178]S[167]LI[178]63:RM[178]0:[139]T$[178]"Y"[167]LI[178]62
2020 RM[178]RM[170]1:BAL[178]LI[171]RM[172](F[170]2)
2025 [139]BAL[179]F[167]2050
2040 [142]
2050 [129]K[178]1[164]BAL[170]2:[152]4,[199](13);
2060 [130]K:LI[178]63:RM[178]0:[142]
2070 [128]
3000 :
3002 : THIS IS A PUBLIC DOMAIN PROGRAM
3004 : RELEASED [181]O THE PUBLIC DOMAIN
3006 : IN 1986 BY:
3008 :
3010 : REX MERRITT
3012 : 2101 TRIMBLE ST.
3014 : VANCOUVER, B.C.
3016 : CANADA V6R 4H5
3018 :
3020 : [139] YOU HAVE ANY QUESTI[145]S,
3022 : COMMENTS [176] SUGGESTI[145]S ABOUT
3024 : THIS PROGRAM, PLEASE FEEL [184]E
3026 : [164] WRITE.